[Proof of concept] Customize Furo to use Qiskit branding #233
+390
−37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Seeing if we can satisfy #232 by using Furo's builtin customization rather than vendoring the theme and modifying the original source code. That will likely be much easier for us to maintain. For example, no need to have infrastructure that uses Node.js to compile the Sass files.
We will need to solve pradyunsg/furo#204 still because we can't expect everyone to put this code in their conf.py and templates folder. We need to pre-set this all and distribute it as our own custom theme.
Customization requirements
Color scheme
We can customize any of Furo's Sass variables via
html_theme_options
. See https://github.com/pradyunsg/furo/blob/main/src/furo/assets/styles/variables/_colors.scss. For example, we set the color here to Qiskit purple:We can also set whatever CSS rules we want in
custom.css
.TODO:
Fonts
This is set via
html_theme_options
, for both the normal font and monospace font. We load the font via Google Fonts loaded in the header.Top nav bar
We extend
base.html
to load our web components, then changepage.html
to render the nav bar at the top of the page.--
TODO:
Footer & analysis code
We extend
base.html
to add our analytics code, then change the footerpage.html
to include our "Was this page helpful?" question. We use Furo'snext page
and copyright code, but could use our own if we wanted.TODO:
<hr>
render? It's in the DOM.Side bar: languages and versions
This works by adding custom side bar elements, set in
conf.py
. While it does not yet have any styling, we can add that in a follow up. The basic proof of concept works and e.g. clicking on the elements works.TODO:
sidebar_hide_name=True